<template>
	<div id="dialog" v-show="dialogShow">
		<div class="dialog-inner">
			<h2>{{title}}</h2>
			<h3>{{musicName}}</h3>
			<h1>{{msg}}</h1>
			<div class="dialog-btn">
				<button type="button" class="close" @click="huoGai">气死我了</button>
				<button type="button" class="close" @click="dialogHide">好吧</button>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		name: "g-dialog",
		props: ["title", "musicName", "msg", "dialogShow"],
		methods: {
			dialogHide() {
				this.$emit("close-dialog");
			},
			huoGai() {
				this.$emit("show-huogai");
			}
		}
	};
</script>

<style scoped>
	#dialog {
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.5);
		position: fixed;
		top: 0;
		left: 0;
		z-index: 999;
	}

	.dialog-inner {
		width: 400px;
		height: 300px;
		background-color: #1e1e22;
		box-shadow: 1px 0px 20px rgba(255, 255, 255, 0.5);
		padding: 20px;
		border-radius: 10px;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		margin: auto;
		text-align: center;
	}

	.close {
		width: 150px;
		height: 45px;
		border: 1px solid pink;
		background-color: transparent;
		color: pink;
		border-radius: 10px;
		outline: none;
		cursor: pointer;
		font-size: 20px;
	}

	.dialog-btn {
		display: flex;
		justify-content: space-around;
	}

	h1 {
		margin: 50px 0;
	}
	h3 {
		margin: 30px 0;
	}
</style>